@charset "UTF-8";
@import './variables';

@mixin text-ellipsis {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

@mixin ellipsis4line($lineCount: 2) {
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: $lineCount;
  -webkit-box-orient: vertical;
}

// clear fix for float
@mixin clearfix($direction: both) {
  &:after {
    display: block;
    clear: $direction;
    content: '';
  }
}

@mixin mask() {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
}

@mixin textShadow() {
  text-shadow: 0 0 1px #000;
}

@mixin inCenter() {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

@mixin standardLRPadding($val) {
  padding-left: $val;
  padding-right: $val;
}

@function pxToRpx($px) {
  @return #{$px * 2}rpx;
}

@mixin boxWithDashed($radius: 40rpx, $color: #007bf8, $padding: 10rpx) {
  position: relative;

  &:before {
    content: '';
    position: absolute;
    z-index: 0;
    top: $padding;
    left: $padding;
    right: $padding;
    bottom: $padding;
    border: 4rpx $color dashed;
    border-radius: $radius;
  }
}

@mixin bgStriped($bgColor: #ffff43, $lineColor: #ecec43, $bgWidth: 15rpx, $lineWidth: 2rpx, $deg: -45deg) {
  background-image: repeating-linear-gradient($deg, $bgColor 0, $bgColor $bgWidth, $lineColor $bgWidth, $lineColor $bgWidth + $lineWidth);
}

@mixin bgPoint($bgColor:#ffa200, $pointColor: #e59200){
  border-radius: 30rpx;
  background: $bgColor;
  background-image: radial-gradient($pointColor 30%, transparent 0), radial-gradient($pointColor 30%, transparent 0);
  background-size: 20px 20px;
  background-size: 0 0, 10rpx 10rpx;
}

@mixin canScroll($direct: y){
  overflow-#{$direct}: auto;
  -webkit-overflow-scrolling: touch;
}